package com.highcom.service.impl;

import com.highcom.mapper.DeptMapper;
import com.highcom.pojo.Dept;
import com.highcom.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    public DeptMapper deptMapper;

    @Override
    public List<Dept> findDepts() {
        return deptMapper.findDepts();
    }

    @Override
    public void delDeptById(int id) {
        deptMapper.delDeptById(id);
    }

    @Override
    public void delDeptsByIds(int[] ids) {
        for (int id : ids) {
            deptMapper.delDeptById(id);
        }
    }

    @Override
    public Dept findDeptById(int id) {
        return deptMapper.findDeptById(id);
    }

    @Override
    public void modifyDept(Dept dept) {
        deptMapper.modifyDept(dept);
    }

    @Override
    public void addDept(Dept dept) {
        deptMapper.addDept(dept);
    }

    @Override
    public List<Dept> findDeptsLikeQuery(Dept dept) {
        return deptMapper.findDeptsLikeQuery(dept);
    }
}
